
#ifndef _USE_SIGNAL_H_
#define _USE_SIGNAL_H_

/*============================ INCLUDES ======================================*/
#include "compiler.h"

# define ENABLE_GLOBAL_INTERRUPT()		GIE = 1
# define DISABLE_GLOBAL_INTERRUPT() 	GIE = 0

#define SREG    GIE
#define GLOABLE_INTERRUPT_ENABLED()     GIE

# define SAFE_ATOM_CODE(__SCODE)     {\
        volatile uint8_t chSREG = SREG;\
        DISABLE_GLOBAL_INTERRUPT();\
        __SCODE;\
        SREG = chSREG;\
    }

# define EXIT_SAFE_ATOM_CODE()          SREG = chSREG


#endif
